package controller.sequentParser;

import java.io.StringReader;

import model.ParseError;
import model.sequent.tokens.Sequent;

/**
 * Contains method(s) for parsing data to a Sequent tree
 * 
 * @author Sjaak Smetsers (number?)
 * @author Karen Berntsen (s0815799)
 * @author Erik Stens (s0615374)
 */
public class SequentParser {
	/**
	 * Parses a string to a Sequent tree using a tail recursive parser
	 * 
	 * @param sequent
	 * @return the Sequent tree
	 */
	public static Sequent parse(String sequent) {
		try {
			StringReader inputReader = new StringReader(sequent);
			SequentTRparser parser = new SequentTRparser(inputReader);
			return parser.parse();
		} catch (ParseError parseError) {
			System.out.printf("Parse error: %s", parseError);
		}
		
		return null;
	}
}
